#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int Fib1(int n)
{
	if (n == 1 || n == 2)return 1;
	return Fib1(n - 1) + Fib1(n - 2);
}

int Fib2(int n)
{
	int a = 1;
	int b = 1;
	int c = 1;
	while (n > 2) {
		a = b;
		b = c;
		c = a + b;
		n--;//
	}
	return c;
}
int main()
{
	int n = 0;
	scanf("%d", &n);
	int ret1, ret2;
	ret1 = Fib1(n);
	ret2 = Fib2(n);
	printf("%d\n", ret1);
	printf("%d", ret2);
	return 0;
}